package com.soso.dao;

import java.util.List;

import javax.persistence.Transient;
import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.soso.entity.Modules;
import com.soso.entity.Rolemodules;

public interface Modulesroles extends JpaRepository<Rolemodules, Integer> {

	@Query(value = "select * from rolemodules where RoleId=?1 and ModuleId=?2",nativeQuery = true)
	public List<Rolemodules> getmodalls(String RoleId,int ModuleId);

	@Transactional
	@Modifying
	@Query(value="delete from rolemodules where ModuleId=?1 and RoleId=?2",nativeQuery = true)
	 public Integer rolemodulesdels(String ModuleId,String RoleId);
	
}
